package com.miao.util.json;

import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.SerializerProvider;

import java.io.IOException;
import java.util.Date;


public class CustomDateSerializer extends JsonSerializer<Date> {
    @Override
    public void serialize(Date value, JsonGenerator generator, SerializerProvider provider) throws IOException {
        if (value != null) {
            generator.writeNumber(value.getTime());
        }
    }

}